using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._LayersandTableViews
{
    /// <summary>
    /// <para>Save To Layer File</para>
    /// <para>Creates an output layer file (.lyrx) from a map layer. The layer file stores many properties of the input layer such as symbology, labeling, and custom pop-ups. Layer files saved from ArcGIS Pro cannot be used in ArcMap.</para>
    /// <para>从地图图层创建输出图层文件 （.lyrx）。图层文件存储输入图层的许多属性，例如符号系统、标注和自定义弹出窗口。从 ArcGIS Pro 保存的图层文件无法在 ArcMap 中使用。</para>
    /// </summary>    
    [DisplayName("Save To Layer File")]
    public class SaveToLayerFile : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public SaveToLayerFile()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_layer">
        /// <para>Input Layer</para>
        /// <para>The map layer to be saved to disk as a layer file.</para>
        /// <para>要作为图层文件保存到磁盘的地图图层。</para>
        /// </param>
        /// <param name="_out_layer">
        /// <para>Output Layer</para>
        /// <para>The output layer file (.lyrx) to be created.</para>
        /// <para>要创建的输出层文件 （.lyrx）。</para>
        /// </param>
        public SaveToLayerFile(object _in_layer, object _out_layer)
        {
            this._in_layer = _in_layer;
            this._out_layer = _out_layer;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Save To Layer File";

        public override string CallName => "management.SaveToLayerFile";

        public override List<string> AcceptEnvironments => ["scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_layer, _out_layer, _is_relative_path.GetGPValue(), _version.GetGPValue()];

        /// <summary>
        /// <para>Input Layer</para>
        /// <para>The map layer to be saved to disk as a layer file.</para>
        /// <para>要作为图层文件保存到磁盘的地图图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_layer { get; set; }


        /// <summary>
        /// <para>Output Layer</para>
        /// <para>The output layer file (.lyrx) to be created.</para>
        /// <para>要创建的输出层文件 （.lyrx）。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_layer { get; set; }


        /// <summary>
        /// <para>Store Relative Path</para>
        /// <para><xdoc>
        ///   <para>Determines if the output layer file will store a relative path to the source data stored on disk, or an absolute path.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—The output layer file will store an absolute path to the source data stored on disk. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—The output layer file will store a relative path to the source data stored on disk. If the output layer file is moved, its source path will update to where the source data should be in relation to the new path.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定输出图层文件是存储磁盘上存储的源数据的相对路径，还是绝对路径。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 输出图层文件将存储磁盘上存储的源数据的绝对路径。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 输出图层文件将存储磁盘上存储的源数据的相对路径。如果移动输出图层文件，其源路径将更新为源数据相对于新路径的位置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Store Relative Path")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _is_relative_path_value? _is_relative_path { get; set; } = null;

        public enum _is_relative_path_value
        {
            /// <summary>
            /// <para>RELATIVE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("RELATIVE")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>ABSOLUTE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ABSOLUTE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Layer Version</para>
        /// <para><xdoc>
        ///   <para>The version of the output layer file.</para>
        ///   <bulletList>
        ///     <bullet_item>Current—The current version. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出图层文件的版本。</para>
        ///   <bulletList>
        ///     <bullet_item>当前 - 当前版本。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Layer Version")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _version_value _version { get; set; } = _version_value._CURRENT;

        public enum _version_value
        {
            /// <summary>
            /// <para>Current</para>
            /// <para>Current—The current version. This is the default.</para>
            /// <para>当前 - 当前版本。这是默认设置。</para>
            /// </summary>
            [Description("Current")]
            [GPEnumValue("CURRENT")]
            _CURRENT,

        }

        public SaveToLayerFile SetEnv(object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}